;;; Commentary:
-;; which-key provides the minor mode which-key-mode for Emacs. The mode displays
+;; which-key provides the minor mode which-key-mode for Emacs. The mode displays
;; the key bindings following your currently entered incomplete command (a
-;; prefix) in a popup. For example, after enabling the minor mode if you enter
+;; prefix) in a popup. For example, after enabling the minor mode if you enter
;; C-x and wait for the default of 1 second the minibuffer will expand with all
;; of the available key bindings that follow C-x (or as many as space allows
-;; given your settings). This includes prefixes like C-x 8 which are shown in a
-;; different face. Screenshots of what the popup will look like along with
+;; given your settings). This includes prefixes like C-x 8 which are shown in a
+;; different face. Screenshots of what the popup will look like along with
;; information about additional features can be found at
;; https://github.com/justbur/emacs-which-key.
;;
;;; Options
(defgroup which-key nil
- "Customization options for which-key-mode"
+ "Customization options for which-key-mode."
:group 'help
:prefix "which-key-")
echo-keystrokes)
"Value to use for `echo-keystrokes'.
This only applies if `which-key-popup-type' is minibuffer or
-`which-key-show-prefix' is echo. It needs to be less than
+`which-key-show-prefix' is echo. It needs to be less than
`which-key-idle-delay' or else the keystroke echo will erase the
which-key popup."
:group 'which-key
(const :tag "Hide" nil)))
(defcustom which-key-popup-type 'side-window
- "Supported types are minibuffer, side-window, frame, and custom"
+ "Supported types are minibuffer, side-window, frame, and custom."
:group 'which-key
:type '(radio (const :tag "Show in minibuffer" minibuffer)
(const :tag "Show in side window" side-window)
(const :tag "Use your custom display functions" custom)))
(defcustom which-key-min-display-lines 1
- "Minimum number of horizontal lines to display in the which-key buffer"
+ "Minimum number of horizontal lines to display in the which-key buffer."
:group 'which-key
:type 'integer)
(defcustom which-key-side-window-location 'bottom
"Location of which-key popup when `which-key-popup-type' is side-window.
-Should be one of top, bottom, left or right. You can also specify
-a list of two locations, like (right bottom). In this case, the
-first location is tried. If there is not enough room, the second
+Should be one of top, bottom, left or right. You can also specify
+a list of two locations, like (right bottom). In this case, the
+first location is tried. If there is not enough room, the second
location is tried."
:group 'which-key
:type '(radio (const right)
\(setq `which-key-idle-secondary-delay' 0.05)
Note that `which-key-idle-delay' should be set before turning on
-`which-key-mode'. "
+`which-key-mode'."
:group 'which-key
:type 'boolean)
(defcustom which-key-allow-regexps nil
"A list of regexp strings to use to filter key sequences.
When non-nil, for a key sequence to trigger the which-key popup
-it must match one of the regexps in this list. The format of the
+it must match one of the regexps in this list. The format of the
key sequences is what is produced by `key-description'."
:group 'which-key
:type '(repeat regexp))
(defface which-key-group-description-face
'((t . (:inherit font-lock-keyword-face)))
- "Face for the key description when it is a group or prefix"
+ "Face for the key description when it is a group or prefix."
:group 'which-key-faces)
(defface which-key-special-key-face
(defface which-key-docstring-face
'((t . (:inherit which-key-note-face)))
- "Face for docstrings"
+ "Face for docstrings."
:group 'which-key-faces)
;;;; Custom popup
(defun which-key-enable-god-mode-support (&optional disable)
"Enable support for god-mode if non-nil.
This is experimental, so you need to explicitly opt-in for
-now. Please report any problems at github. If DISABLE is non-nil
+now. Please report any problems at github. If DISABLE is non-nil
disable support."
(interactive "P")
(setq which-key--god-mode-support-enabled (null disable))
;;;###autoload
(defun which-key-setup-minibuffer ()
"Apply suggested settings for minibuffer.
-Do not use this setup if you use the paging commands. Instead use
+Do not use this setup if you use the paging commands. Instead use
`which-key-setup-side-window-bottom', which is nearly identical
but more functional."
(interactive)
(or (which-key--safe-lookup-key-description keymap key)
(make-sparse-keymap))))
(t
- (user-error "replacement is neither a cons cell or a string")))))
+ (user-error "Replacement is neither a cons cell or a string")))))
(define-key keymap (kbd key) def))
(setq key (pop more)
replacement (pop more))))
(defun which-key--maybe-replace (key-binding)
"Use `which-key--replacement-alist' to maybe replace KEY-BINDING.
KEY-BINDING is a cons cell of the form \(KEY . BINDING\) each of
-which are strings. KEY is of the form produced by `key-binding'."
+which are strings. KEY is of the form produced by `key-binding'."
(let* ((replacer (if which-key-allow-multiple-replacements
#'which-key--replace-in-repl-list-many
#'which-key--replace-in-repl-list-once)))
(defun which-key--maybe-add-docstring (current original)
"Maybe concat a docstring to CURRENT and return result.
Specifically, do this if ORIGINAL is a command with a docstring
-and `which-key-show-docstrings' is non-nil. If
+and `which-key-show-docstrings' is non-nil. If
`which-key-show-docstrings' is the symbol docstring-only, just
return the docstring."
(let* ((orig-sym (intern original))
(keymap &optional start prefix filter all evil)
"Retrieve top-level bindings from KEYMAP.
PREFIX limits bindings to those starting with this key
-sequence. START is a list of existing bindings to add to. If ALL
+sequence. START is a list of existing bindings to add to. If ALL
is non-nil, recursively retrieve all bindings below PREFIX. If
EVIL is non-nil, extract active evil bidings."
(let ((bindings start)
(defun which-key-reload-key-sequence (&optional key-seq)
"Simulate entering the key sequence KEY-SEQ.
KEY-SEQ should be a list of events as produced by
-`listify-key-sequence'. If nil, KEY-SEQ defaults to
+`listify-key-sequence'. If nil, KEY-SEQ defaults to
`which-key--current-key-list'. Any prefix arguments that were
used are reapplied to the new key sequence."
(let* ((key-seq (or key-seq (which-key--current-key-list)))